import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('color', () => {
  // state
  const count = ref(0)

  // action
  const setCount = () => {
    count.value++
  }

  // getter
  const doubleCount = () => count.value * 2
  return {
    count,
    setCount,
    doubleCount,
  }
})
